package subject_set.interview.Day4_17_zijie;

/**
 * @author haomin
 * @date 2023/04/17 20:39
 **/
// 单例模式->饿汉模式 需要时在进行创建实例
public class LazyMode {
    private static volatile LazyMode instance = null;

    public static LazyMode getInstance() {
        if(instance == null) {
            synchronized(LazyMode.class) {
                if(instance == null) {
                    instance = new LazyMode();
                }
            }
        }
        return instance;
    }

    private LazyMode() {}
}